import React from 'react'
import {Button, Icon} from 'antd';
import FBHeaderView from '../../component/form-header/View';
import {WeaLocaleProvider} from "ecCom";
import {Consumer} from "../../theme";

const getLabel = WeaLocaleProvider.getLabel;
const formatMultiLang = WeaLocaleProvider.formatMultiLang;

export default class Confirm extends React.Component {
  render() {
    const { title, handleNew, handleEdit, showHeader } = this.props;

    return (
      <div className='wea-edc-confirm-box'>
        {
          showHeader ? 
          <FBHeaderView data={{}} /> : null
        }
        <div className='wea-edc-confirm-content'>
          <div style={{ color: '#71B300', fontSize: 50 }}><Icon type="heart" /></div>
          <div style={{ fontSize: 18, paddingBottom: 3 }}>{formatMultiLang(title)}</div>
          <p style={{ fontSize: 16, color: '#777' }}>{getLabel('511838','你已填写过该表单，可以选择修改上次填写的数据，也可以填写一份新的。')}</p>
          <div className='wea-edc-confirm-buts'>
            <Consumer>
              {({ submitBtn }) => (
                <Button
                  type='primary'
                  onClick={handleNew}
                  style={Object.assign({fontSize: 14, height: 40, marginRight: 30}, submitBtn.css)}
                >
                  {getLabel('511839','填份新的')}
                </Button>
              )}
            </Consumer>

            <Button
              type='primary'
              onClick={handleEdit}
              style={{fontSize: 14, height: 40, backgroundColor: '#ebebeb', borderColor: '#ebebeb', color: '#555'}}
            >
              {getLabel('511840','修改上次填写')}
            </Button>
          </div>

        </div>
      </div>
    )
  }
}